package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.BuyCollectionDiscount;
import com.sc.nft.entity.vo.BuyCollectionDiscountListVO;
import com.sc.nft.mapper.BuyCollectionDiscountMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * (sc_buy_collection_discount)数据DAO
 *
 * @author Sun
 * @since 2022-08-19 11:28:22
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class BuyCollectionDiscountDao extends ServiceImpl<BuyCollectionDiscountMapper, BuyCollectionDiscount> {

    public List<BuyCollectionDiscount> getMinDiscountByProductId(Long productId) {
        LambdaQueryWrapper<BuyCollectionDiscount> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(BuyCollectionDiscount::getProductId,productId);
        return list(wrapper);
    }

    public List<BuyCollectionDiscountListVO> buyCollectionDiscountList(Long id) {
        return baseMapper.buyCollectionDiscountList(id);
    }

    public BuyCollectionDiscount selectByProductIdAndCollectionId(Long productId, Long collectionId) {
        return null;
    }
}